import request from '@/services/request'

const ModelDesignApi = {
    /**
     * 获取列表
     * @param params
     * @returns {AxiosPromise}
     */
    getPageList(params) {
        return request({
            url: 'api/irms/modeldesign/list',
            method: 'get',
            params
        })
    },
    /**
     * 获取列表
     * @param params
     * @returns {AxiosPromise}
     */
    getList(params) {
        return request({
            url: 'api/irms/modeldesign/listAll',
            method: 'get',
            params
        })
    },

    /**
     * 新增更新模板库
     * @param params
     * @returns {AxiosPromise}
     */
    insert(params) {
        return request({
            url: 'api/irms/modeldesign/insert',
            method: 'post',
            data: params
        })
    },

    /**
     * 更新模板库
     * @param params
     * @returns {AxiosPromise}
     */
    update(params) {
        return request({
            url: 'api/irms/modeldesign/update',
            method: 'post',
            data: params
        })
    },


    /**
     * 新增/修改数据
     * @param params
     * @returns {AxiosPromise}
     */
    createHtml(params) {
        return request({
            url: 'api/irms/modeldesign/createHtml',
            method: 'post',
            data: params
        })
    },

    /**
     * 查询数据
     * @param params
     * @returns {AxiosPromise}
     */
    getDetail(params) {
        return request({
            url: 'api/irms/modeldesign/getInfo',
            method: 'get',
            params
        })
    },
    /**
     * 发布
     * @param params
     * @returns {AxiosPromise}
     */
    release: function release(params) {
        return request({
            url: 'api/irms/modeldesign/release',
            method: 'post',
            data: params
        })
    },


    /**
     * 获取全量在线医生列表
     * @param params
     * @returns {AxiosPromise}
     */
    getCatchInfo: function getCatchInfo(params) {
        return request({
            url: 'api/irms/modeldesign/getCatchInfo',
            method: 'get',
            params
        })
    },

    /**
     * 删除数据
     * @param ids
     * @returns {AxiosPromise}
     */
    remove(params) {
        return request({
            url: 'api/irms/modeldesign/delete',
            method: 'get',
            params,
        })
    },
    /**
     * 选择素材
     * @param params
     * @returns {*}
     */
    getAllMaterial(params) {
        return request({
            url: 'api/irms/material/list',
            method: 'post',
            data: params
        })
    },

    getMaterial(params) {
        return request({
            url: 'api/irms/material/listPage',
            method: 'post',
            data: params
        })
    },



    //模板名称唯一姓校验
    templateNameOnly(params) {
        return request({
            url: 'api/irms/modeldesign/isExist',
            method: 'post',
            data: params
        })
    },

    //号别的选项
    registerObjNameOptions(params) {
        return request({
            url: `system/dict/data/type/${params}`,
            method: 'get',
        })
    },
    /**
     * 发送上屏预览申请
     * @param data
     */
    sendMsgToScreenLoadLocalTemplate(data) {
        return request({
            url: 'api/irms/modelpush/sendMsgToScreenLoadLocalTemplate',
            method: 'post',
            data: data
        });
    },
    /**
     * 获取本地模板数据
     * @param data
     * @returns {*}
     */
    getScreenLocalTemplate(data) {
        return request({
            url: 'api/irms/modelpush/getScreenLocalTemplate',
            method: 'post',
            data: data
        });
    },

    // 文档转化图片
    getSourceChangePicture(params) {
        return request({
            url: 'api/irms/material/getSource',
            method: 'get',
            params,
        });
    }
};

export {ModelDesignApi}


